/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bddfirstproject.view.renderer;

import bddfirstproject.model.PartieRedaction;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

/**
 *
 * @author epulapp
 */
public class ListArticleRenderer extends DefaultListCellRenderer {

    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        
        PartieRedaction article = (PartieRedaction)value;
        // Recuperation du nom de la partie (de l'article)
        setText(article.getTitrePartie());
        return this;
    }
    
}
